﻿using Base.Common.Events;
using Base.ModuleBase;
using Base.ModuleBase.Dialogs.ViewModels;
using Prism.Commands;
using Prism.Common;
using Prism.Events;
using Prism.Ioc;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Input;

namespace Modules.ModuleA.ViewModels
{
    public class CommonInfoViewModel : DialogViewModelBase
    {
        #region 成员

        #endregion

        #region 属性
        private string m_StringValue = string.Empty;
        /// <summary>
        /// 测试值
        /// </summary>
        public string StringValue
        {
            get
            {
                return m_StringValue;
            }
            set
            {
                SetProperty(ref m_StringValue, value);
            }
        }

        #endregion

        #region 构造
        public CommonInfoViewModel()
        {
            StringValue = "测试弹出页面";
        }
        #endregion

        #region 方法

        #region 重写
        /// <summary>
        /// 打开事件
        /// </summary>
        /// <param name="parameters"></param>
        public override void OnDialogOpened(IDialogParameters parameters)
        {
            var Message = parameters.GetValue<string>("message");
        }

        /// <summary>
        /// 关闭事件
        /// </summary>
        public override void OnDialogClosed()
        {

        }
        #endregion

        #region 命令
        /// <summary>
        /// 测试按钮
        /// </summary>
        public DelegateCommand<object> TempCommand
        {
            get
            {
                return new DelegateCommand<object>(p =>
                {
                    StringValue = "测试";
                });
            }
        }

        #endregion

        #endregion
    }
}
